<%@page import="com.hdl.entity.MallProduct"%>

<%@ page language="java" pageEncoding="UTF-8"%><!DOCTYPE html>
<html>
<head>
<title>Insert title here</title>
<jsp:include page="/admin/head.jsp"></jsp:include>
</head>
<body>
<jsp:include page="/admin/header.jsp"></jsp:include>
<jsp:include page="/admin/left-menu.jsp?leftMenu=3"></jsp:include>
<jsp:include page="/admin/footer.jsp"></jsp:include>


      <section>
      <nav aria-label="breadcrumb">
			<ol class="breadcrumb">
				<li class="breadcrumb-item">管理首页</li>
				<li class="breadcrumb-item">产品中心</li>
				<li class="breadcrumb-item">产品管理</li>
				<li class="breadcrumb-item active">添加</li>
			</ol>
		</nav>
     
		      <div class="card container-md">
        <div class="card-body">
          <form name="updateForm" action="admin/mallproduct-add.let" method="POST" enctype="multipart/form-data">
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>商品名称</label>
              <div class="col-sm-9">
                <input required="required" class="form-control"  name="mallProductName" value="">
              </div>
            </div>

            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>商品类型</label>
              <div class="col-sm-9">
                <select required="required" name="mallTypeId" class="form-control" style="width: auto;">
                  <option value="">请选择</option>
                  <option value="1">锅底</option>
                  <option value="2">涮菜</option>
                  <option value="3">特色蘸料</option>
                  <option value="4">小吃甜品</option>
                  <option value="5">特色饮品</option>
                 
                </select>
              </div>
            </div>
            
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>商品价格</label>
              <div class="col-sm-9">
                <input required="required" class="form-control"  name="mallProductPrice1"value="">
              </div>
            </div>
            
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>商品图片地址</label>
              <div class="col-sm-6">
                <input required="required"  name="mallProductPath" value="" type="file" id="log">
              </div>
              <div class="col-sm-3">
              	<img alt="" src="" id="img" style="width:40px;height:40px">
              </div>
            </div>
            
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>商品描述</label>
              <div class="col-sm-9">
                <input required="required" class="form-control"  name="mallProductMs" value="">
              </div>
            </div>
            
            <div class="form-group row">
              <label class="col-sm-3 col-form-label text-right"><b class="text-danger">*</b>商品积分</label>
              <div class="col-sm-9">
                <input required="required"   name="mallProductScore" value="" >
              </div>
            </div>
            
            

            <div class="form-group row">
              <div class="col-sm-9 offset-sm-3">
                <button class="btn btn-primary" type="button" onclick="history.go(-1);">返回 </button>
                <button class="btn btn-danger" type="submit"><i class="fa fa-edit mr-2"></i>添加</button>
              </div>
            </div>

          </form>
        </div>
      </div>
      </section>
</body>
</html>
<script>
	//选择头像
	var oFile = document.querySelector("#log");
	var oImg = document.querySelector('#img');
	oFile.addEventListener("change",function(){
	    let f = oFile.files[0];
	    if(f==undefined){
	        oImg.src='img/1.jpg';
	    }else{
	        let reader = new FileReader();
	        reader.addEventListener("load",function () {
	            oImg.src= reader.result;
	        })
	        reader.readAsDataURL(f);
	    }
	     });
	
</script>